/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package EntityBeans;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Keith Augustsson
 */
@Entity
@Table(name = "seats")
@NamedQueries({@NamedQuery(name = "Seats.findAll", query = "SELECT s FROM Seats s"), @NamedQuery(name = "Seats.findByNr", query = "SELECT s FROM Seats s WHERE s.seatsPK.nr = :nr"), @NamedQuery(name = "Seats.findBySRow", query = "SELECT s FROM Seats s WHERE s.seatsPK.sRow = :sRow"), @NamedQuery(name = "Seats.findByAircraft", query = "SELECT s FROM Seats s WHERE s.aircraft = :aircraft")})
public class Seats implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected SeatsPK seatsPK;
    @Column(name = "aircraft")
    private String aircraft;

    public Seats() {
    }

    public Seats(SeatsPK seatsPK) {
        this.seatsPK = seatsPK;
    }

    public Seats(int nr, char sRow) {
        this.seatsPK = new SeatsPK(nr, sRow);
    }

    public SeatsPK getSeatsPK() {
        return seatsPK;
    }

    public void setSeatsPK(SeatsPK seatsPK) {
        this.seatsPK = seatsPK;
    }

    public String getAircraft() {
        return aircraft;
    }

    public void setAircraft(String aircraft) {
        this.aircraft = aircraft;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (seatsPK != null ? seatsPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Seats)) {
            return false;
        }
        Seats other = (Seats) object;
        if ((this.seatsPK == null && other.seatsPK != null) || (this.seatsPK != null && !this.seatsPK.equals(other.seatsPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "EntityBeans.Seats[seatsPK=" + seatsPK + "]";
    }

}
